export default {
  data: function () {
    return {
      _mixDelSelected: []
    }
  },
  methods: {
    _mixSelectionChange (selected) {
      this._mixDelSelected = selected
    },
    _mixMutiDel(delfnName, cb) {
      if (this._mixDelSelected.length < 1) return ;
      const ids = this._mixDelSelected.map(item => item.id).join(',');
      this.$confirm(`确认删除编号为${ids}的行吗？`, '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        })
      .then(() => {
        this.$API[delfnName](ids)
        .then(data => {
          cb()
        })
      }).catch(() => {
        this.$message({
          type: 'info',
          message: '已取消删除'
        });
      });
    }
  }
}
